/*
 * @Author: Dufen~123 dufen.0
 * @Date: 2024-12-25 16:04:32
 * @LastEditors: Dufen~123 dufen.0
 * @LastEditTime: 2024-12-25 16:05:24
 * @FilePath: \my-app\src\pages\ParentComponent3\components\ChildComponent3.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from 'react';

const ChildComponent = (props) => {
  const sendMessage = () => {
    props.handleMessage('Hello from ChildComponent!');
  };

  return (
    <div>
      <h2>子组件</h2>
      <button onClick={sendMessage}>发送消息给父组件</button>
    </div>
  );
};

export default ChildComponent;
